package homework;

public class Count {

    public static void main(String[] args) {
        // 统计数字字符的数量
        String string = "hasdfasf124fdf7DFASF74XSD";
        int[] arr = new int[10];
        for (int i = 0; i < string.length(); i++) {
            if (string.charAt(i) > '0' && string.charAt(i) < '9') {
                arr[string.charAt(i) - '0']++;
            }
        }
        for (int i = 0; i < arr.length; i++) {
            System.out.println(i+","+arr[i]);
        }

    }

}
